<template>
  <div class="page">
    <h1>后台页面</h1>
    <p>这里需要登录后才能访问。</p>
    <button @click="logout">退出登录</button>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
const router = useRouter()

function logout() {
  localStorage.removeItem('token')
  router.push('/LoginView')
}
</script>

<!-- 这里标记需要登录 -->
<script lang="ts">
export default {
  meta: {
    requireAuth: true,
  },
}
</script>
